package demo;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;

import com.example.tianjin.heyilianchuang.chali.calculator20231122.box_heyi_20231122.R;


public class TipDialog extends Dialog {
    private Context mContext;
    private long mStartTime;
    private long mleastShowTime = 2;
    private TextView mTipsView;
    private String[] mTips = {};
    private int mFontColor;
    private int mIndex = 0;
    private int mPercent = 0;
    private View mLayout;
    Handler mSplashHandler = new Handler();

    public TipDialog(Context context) {
        super(context, R.style.Splash);
        mContext = context;
    }

    public void showSplash() {
        this.show();
        mStartTime = System.currentTimeMillis();
        mSplashHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                TipDialog.this.dismiss();
            }
        }, 3000);
    }

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.tip_dialog);
        mTipsView = (TextView)findViewById(R.id.tipsView);
        mLayout = findViewById(R.id.layout);
    }
    @Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        if(event.getKeyCode() == KeyEvent.KEYCODE_BACK){
            return true;
        }else {
            return super.dispatchKeyEvent(event);
        }
    }
}
